package com.lili.order.controller.order;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import com.lili.common.result.Result;
import com.lili.model.order.entity.order.Order;
import com.lili.order.service.order.OrderService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 *  用户信息管理
 */
@Api(tags = "订单展示")
@RestController
@RequestMapping("/admin/order/orders")
public class OrderController {

    @Autowired
    private OrderService orderService;

    @ApiOperation("订单列表")
    @GetMapping("/admin/getAll")
    public Result getAllOrders(){
        List<Order> list = orderService.getAllOrders();
        return Result.ok(list);
    }
    @ApiOperation("订单分页列表")
    @PostMapping("/getAllByPage")
    public Result getAllOrderByPage(@RequestBody Map map){
        Page<Order> page = orderService.getAllOrdersByPage(map);
        return Result.ok(page);
    }


}
